﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Mechanical;
using Autodesk.Revit.UI.Selection;

namespace YArchitech.HCLoad.Export
{
	public class HYSpaceFilter : ISelectionFilter
	{
		public HYSpaceFilter(Level level)
		{
			this.m_level = level;
		}

		public bool AllowElement(Element element)
		{
			return element is Space && (element as Space).LevelId.IntegerValue == this.m_level.Id.IntegerValue;
		}

		public bool AllowReference(Reference refer, XYZ point)
		{
			return true;
		}

		private Level m_level;
	}
}
